<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/7/2
 * Time: 21:19
 */

namespace common\models\Service;


use common\models\Cache;

class TeamSetting {

    public static function getTeam($id){
        $cache_name = "team_$id";
        $cache = Cache::get($cache_name);
        if($cache)
            return $cache;
        $team = \common\models\DAO\TeamSetting::findOne($id);
        $info = ['person'=>$team['person'], 'rate'=>$team['rate'], 'money'=>$team['money']];
        Cache::set($cache_name, $info);
        return $info;
    }
}